home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Invalid Indirection???
- Date: Sun, 24 Mar 96 21:43:32 GMT
- Organization: none
- Message-ID: <827703812snz@genesis.demon.co.uk>
- References: <4i7cck$t67@infa.central.susx.ac.uk> <4iah9k$r02@newshost.cyberramp.net> <danpop.826916016@rscernix> <4ips1j$fq0@airdmhor.gen.nz> <1996Mar22.132529.4258@ms.philips.nl>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <1996Mar22.132529.4258@ms.philips.nl>
- Pvestjen@ms.philips.nl "Patrick Vestjens" writes:
-
- >I've been following this discussion and in my opinion there is at least
- >one situation where spaces DO make a difference. If you leave out the
- >space after the / in the expression "a / *b" (a divided by the value
- >optained after dereferencing b) you get "a /*b" where the /* is
- >interpreted (at least by the GNU preprocessor) as the start of a
- >comment.
-
- The problem only occurs when one token forms a prefix to (i.e. the
- initial segment of) another token. The compiler always matches the
- longest possible token. For example - is a prefix to -- so
- when the compiler sees
-
- a --b;
-
- you get a syntax error because -- here is the decrement operator. However
-
- a - -b;
-
- is fine because here you have 2 separate - tokens and this is equivalent to
-
- a - (-b);
-
- Similarly:
-
- a---b; is equilalent to a-- -b;
-
- >Note however that comments are not in the grammar (they are being taken
- >care of by the preprocessor) so this does not introduce an ambiguity in
- >the grammar.
-
- The character sequence /* doesn't form part of any valid token, except in a
- string literal where its meaning as a comment delimiter is suppressed.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-